package com.taptech.doufu.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.taptech.doufu.R;
import com.taptech.doufu.services.GiftService;
import com.taptech.doufu.ui.activity.base.DiaobaoBaseActivity;

/**
 * Created by Wyatt on 2017/7/7/007.
 */

public class NoMoneyTipActivity extends DiaobaoBaseActivity {
    public static final String INTENT_KEY_TIP = "intent_key_tip";
    // pay dialog view
    private TextView payCancelBtn;
    private TextView jumpToPayBtn;
    private TextView payDesContentText;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_no_money);
        initPayDialogView();
    }
    /**
     * 缺钱弹窗初始化
     */
    private void initPayDialogView(){
        payCancelBtn = (TextView)findViewById(R.id.pay_cancel_btn);
        jumpToPayBtn = (TextView)findViewById(R.id.jump_to_pay_btn);
        String tip = getIntent().getStringExtra(INTENT_KEY_TIP);
        payDesContentText = (TextView) findViewById(R.id.text_des_content);
        payDesContentText.setText(tip);
        payCancelBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                DiaobaoBaseActivity.exitAnimAlpha(NoMoneyTipActivity.this);
            }
        });
        jumpToPayBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                GiftService.enterPayWebActivity(NoMoneyTipActivity.this);
                finish();
                DiaobaoBaseActivity.exitAnimAlpha(NoMoneyTipActivity.this);
            }
        });
    }
}
